package com.com.xinke.edu.petmall.activity;

import android.os.Bundle;
import android.view.LayoutInflater;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

import com.bumptech.glide.Glide;
import com.com.xinke.edu.petmall.R;
import com.com.xinke.edu.petmall.databinding.ActivityProductDetailBinding;
import com.com.xinke.edu.petmall.entity.Product;

import java.io.Serializable;

public class ProductDetailActivity extends AppCompatActivity {
ActivityProductDetailBinding binding;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
//        EdgeToEdge.enable(this);
        binding=ActivityProductDetailBinding.inflate(LayoutInflater.from(this));
        setContentView(binding.getRoot());
        Product product = (Product) getIntent().getSerializableExtra("product");
        Glide.with(this).load(product.getCoverImage()).into(binding.img);
        binding.name.setText(product.getName());
        binding.price.setText("￥"+product.getPrice());
        binding.detail.setText(product.getDescription());
    }
}